import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '@/views/login/index.vue')
  },
  {
    path: '/',
    name: 'layout',
    component: () => import(/* webpackChunkName: "layout" */ '@/views/layout/index.vue'),
    children: [{
      path: '/list',
      name: 'list',
      component: () => import(/* webpackChunkName: "list" */ '@/views/list/index.vue')
    }, {
      path: '/home',
      name: 'home',
      component: () => import(/* webpackChunkName: "home" */ '@/views/home/index.vue')
    }, {
      path: '/user/info',
      name: 'userInfo',
      component: () => import(/* webpackChunkName: "userInfo" */ '@/views/userInfo/index.vue')
    }]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
